home *** CD-ROM | disk | FTP | other *** search
/ EnigmA Amiga Run 1996 June / EnigmA AMIGA RUN 08 (1996)(G.R. Edizioni)(IT)[!][issue 1996-06][EARSAN CD VII].iso / earcd / editor / ue312amy.lha / amiga / amiga.diffs < prev    next >
Text File  |  1996-04-24  |  22KB  |  851 lines

  1. diff -adrc orig/h/eproto.h ue312/h/eproto.h
  2. *** orig/h/eproto.h    Wed Apr 21 15:22:28 1993
  3. --- ue312/h/eproto.h    Wed Apr 24 16:24:00 1996
  4. ***************
  5. *** 36,41 ****
  6. --- 36,47 ----
  7.   extern VOID PASCAL NEAR vtscreen (SCREEN *sp);
  8.   #endif
  9.   
  10. + #if AMIGA
  11. + #ifdef __SASC
  12. + int FileReq(char *, char *, unsigned);
  13. + #endif
  14. + #endif
  15.   #if CALLED
  16.   extern int emacs(int argc, char *argv[]);
  17.   #endif
  18. ***************
  19. *** 541,546 ****
  20. --- 547,553 ----
  21.   #include <stdlib.h>
  22.   #include <string.h>
  23.   #else
  24. + #if !(defined(__SASC) && defined(_STRING_H))
  25.   char *strcat(char *, char *);
  26.   char *strcpy(char *, char *);
  27.   int  strlen(char *);
  28. ***************
  29. *** 547,552 ****
  30. --- 554,560 ----
  31.   int  strncmp(char *, char *, int);
  32.   char *strchr(char *, int);
  33.   int  strcmp(char *, char *);
  34. + #endif
  35.   char *realloc(char *block, int siz);
  36.   #if RAMSIZE == 0
  37.   char *malloc(int);
  38. diff -adrc orig/src/amigados.c ue312/src/amigados.c
  39. *** orig/src/amigados.c    Tue Mar 02 16:23:54 1993
  40. --- ue312/src/amigados.c    Wed Apr 24 17:16:33 1996
  41. ***************
  42. *** 4,15 ****
  43. --- 4,69 ----
  44.   */
  45.   
  46.   #include        <stdio.h>
  47. + #ifdef __SASC
  48. + #include    <string.h>
  49. + #else
  50. + #define __aligned
  51. + #endif
  52.   #include    "estruct.h"
  53.   #if    AMIGA
  54.   #include    <exec/types.h>
  55.   #include    <exec/io.h>
  56. + #include    <exec/memory.h>
  57. + #include    <exec/libraries.h>
  58. + #include    <devices/inputevent.h>
  59. + #include    <graphics/text.h>
  60. + #include    <graphics/gfxbase.h>
  61. + #include    <graphics/view.h>
  62. + #include    <graphics/displayinfo.h>
  63.   #include    <intuition/intuition.h>
  64. + #include    <intuition/intuitionbase.h>
  65. + #include    <intuition/screens.h>
  66. + #include    <utility/tagitem.h>
  67. + #include    <libraries/asl.h>
  68.   #include    <devices/console.h>
  69. + #include    <dos/dos.h>
  70. + #ifdef __SASC
  71. + #include <proto/dos.h>
  72. + #include <clib/exec_protos.h>
  73. + #include <clib/graphics_protos.h>
  74. + #include <clib/intuition_protos.h>
  75. + #include <clib/console_protos.h>
  76. + #include <clib/asl_protos.h>
  77. + #include <pragmas/exec_pragmas.h>
  78. + #include <pragmas/graphics_pragmas.h>
  79. + #include <pragmas/intuition_pragmas.h>
  80. + #include <pragmas/console_pragmas.h>
  81. + #include <pragmas/asl_pragmas.h>
  82. + void in_init(void);
  83. + int in_check(void);
  84. + void in_put(int);
  85. + int in_get(void);
  86. + int mod(int);
  87. + int sendcon(char *buf);
  88. + int doevent(void);
  89. + void dokey(struct InputEvent *);
  90. + int stuffibuf(int, int, int );
  91. + int spawncli(int , int );
  92. + int spawn(int , int );
  93. + int execprg(int , int );
  94. + int pipecmd(int , int );
  95. + void adoshello(void);
  96. + char *MakePathname(char *, char *);
  97. + int FileReq(char *, char *, unsigned);
  98. + #endif
  99. + #ifdef AZTEC_C
  100. + #define memset(a,b,c) setmem(a,c,b)
  101. + #endif
  102.   #include    "eproto.h"
  103.   #include        "edef.h"
  104.   #include    "elang.h"
  105. ***************
  106. *** 16,33 ****
  107.   
  108.   #define INTUITION_REV    0L
  109.   #define    NEW         1006L
  110. ! #define    CRWIDTH        8
  111.   #define    CRHEIGHT    8
  112.   
  113. ! struct IntuitionBase *IntuitionBase;
  114.   struct Window *win;
  115.   struct IOStdReq con;        /* ptr to console device driver handle */
  116.   
  117.   /*    Intuition Function type declarations    */
  118.   
  119. ! struct IntuitionBase *OpenLibrary();
  120.   struct Window *OpenWindow();
  121. ! struct IntuiMessage *GetMsg();
  122.   
  123.   typedef struct {
  124.       short rw_code;        /* normal keycode to generate */
  125. --- 70,108 ----
  126.   
  127.   #define INTUITION_REV    0L
  128.   #define    NEW         1006L
  129. ! #ifdef FORCE_TOPAZ80 /* FORCE_TOPAZ80 is obsolete, now we're font sensitive */
  130. ! #define    CRWIDTH        8 /* constant values for TOPAZ80 */
  131.   #define    CRHEIGHT    8
  132. + #else
  133. + #define    CRWIDTH        theFont->tf_XSize  /* now font sensitive, */
  134. + #define    CRHEIGHT    theFont->tf_YSize  /* use variable values */
  135. + #endif
  136.   
  137. ! struct IntuitionBase *IntuitionBase = 0L;
  138. ! struct GfxBase *GfxBase = 0L;
  139. ! struct Library *ConsoleDevice = 0L;
  140. ! struct Library *AslBase = 0L;
  141. ! struct Screen *scr;
  142.   struct Window *win;
  143.   struct IOStdReq con;        /* ptr to console device driver handle */
  144. + static struct TextFont *theFont;
  145. + #ifdef FORCE_TOPAZ80 /* FORCE_TOPAZ80 is obsolete, now we're font sensitive */
  146. + static struct TextAttr *theTextAttr;
  147. + #endif
  148.   
  149.   /*    Intuition Function type declarations    */
  150.   
  151. ! #ifndef __SASC
  152. ! struct Library *OpenLibrary();
  153.   struct Window *OpenWindow();
  154. ! struct Message *GetMsg();
  155. ! #endif
  156. ! #ifdef AMIGA
  157. ! extern NOSHARE TERM term;
  158. ! #endif
  159.   
  160.   typedef struct {
  161.       short rw_code;        /* normal keycode to generate */
  162. ***************
  163. *** 165,177 ****
  164.   int in_next = 0;        /* pos to retrieve next input character */
  165.   int in_last = 0;        /* pos to place most recent input character */
  166.   
  167. ! in_init()    /* initialize the input buffer */
  168.   
  169.   {
  170.       in_next = in_last = 0;
  171.   }
  172.   
  173. ! in_check()    /* is the input buffer non-empty? */
  174.   
  175.   {
  176.       if (in_next == in_last)
  177. --- 240,252 ----
  178.   int in_next = 0;        /* pos to retrieve next input character */
  179.   int in_last = 0;        /* pos to place most recent input character */
  180.   
  181. ! void in_init()    /* initialize the input buffer */
  182.   
  183.   {
  184.       in_next = in_last = 0;
  185.   }
  186.   
  187. ! int in_check()    /* is the input buffer non-empty? */
  188.   
  189.   {
  190.       if (in_next == in_last)
  191. ***************
  192. *** 180,186 ****
  193.           return(TRUE);
  194.   }
  195.   
  196. ! in_put(event)
  197.   
  198.   int event;    /* event to enter into the input buffer */
  199.   
  200. --- 255,261 ----
  201.           return(TRUE);
  202.   }
  203.   
  204. ! void in_put(event)
  205.   
  206.   int event;    /* event to enter into the input buffer */
  207.   
  208. ***************
  209. *** 206,212 ****
  210.    */
  211.   ttopen()
  212.   {
  213. !     struct NewWindow new_win;
  214.       int i;
  215.   #if    AZTEC
  216.       extern    Enable_Abort;    /* Turn off ctrl-C interrupt */
  217. --- 281,293 ----
  218.    */
  219.   ttopen()
  220.   {
  221. !     struct Screen *DefaultScr;
  222. !     struct NewScreen *new_scr = 0L;
  223. !     __aligned struct NewWindow new_win;
  224. ! #ifdef FORCE_TOPAZ80
  225. !     __aligned static char fontname[] = "topaz.font";
  226. ! #endif
  227.       int i;
  228.   #if    AZTEC
  229.       extern    Enable_Abort;    /* Turn off ctrl-C interrupt */
  230. ***************
  231. *** 215,265 ****
  232.   #endif
  233.       strcpy(os, "AMIGADOS");
  234.   
  235.       /* open the intuition library */
  236.       IntuitionBase = (struct IntuitionBase *)
  237.           OpenLibrary("intuition.library", INTUITION_REV);
  238.       if (IntuitionBase == NULL) {
  239.           printf("%%Can not open Intuition\n");
  240.           exit(-1);
  241.       }
  242.   
  243.       /* initialize the new windows attributes */
  244.       new_win.LeftEdge = 0;
  245.       new_win.TopEdge = 0;
  246.       new_win.Width = 640;
  247. !     new_win.Height = 200;
  248.       new_win.DetailPen = 0;
  249.       new_win.BlockPen = 1;
  250.       new_win.Title = (unsigned char *)"MicroEMACS 3.12g/Amiga";
  251.       new_win.Flags = WINDOWCLOSE | SMART_REFRESH | ACTIVATE |
  252.           WINDOWDRAG | WINDOWDEPTH | WINDOWSIZING | SIZEBRIGHT |
  253.           RMBTRAP | NOCAREREFRESH;
  254.       new_win.IDCMPFlags = CLOSEWINDOW | NEWSIZE | MOUSEBUTTONS |
  255.           RAWKEY;
  256. !     new_win.Type = WBENCHSCREEN;
  257.       new_win.FirstGadget = NULL;
  258.       new_win.CheckMark = NULL;
  259. !     new_win.Screen = NULL;
  260.       new_win.BitMap = NULL;
  261.       new_win.MinWidth = 100;
  262.       new_win.MinHeight = 25;
  263. !     new_win.MaxWidth = 640;
  264. !     new_win.MaxHeight = 200;
  265.   
  266.       /* open the window! */
  267.       win = (struct Window *)OpenWindow(&new_win);
  268.       if (win == NULL) {
  269.           printf("%%Can not open a window\n");
  270.           exit(-2);
  271.       }
  272.       /* and open up the console for output */
  273.       con.io_Data = (APTR)win;
  274. !     OpenDevice("console.device", 0, &con, 0);
  275.   
  276.       /* and init all the keyboard flags */
  277.       r_shiftflag = FALSE;
  278. !     l_shiftflag = FALSE;    r_altflag = FALSE;
  279.       l_altflag = FALSE;
  280.       r_amiflag = FALSE;
  281.       l_amiflag = FALSE;
  282. --- 296,458 ----
  283.   #endif
  284.       strcpy(os, "AMIGADOS");
  285.   
  286. +     GfxBase = (struct GfxBase *)OpenLibrary("graphics.library", 33L);
  287. +     if (GfxBase == NULL) {
  288. +         printf("%%Can not open graphics.library\n");
  289. +         exit(-1);
  290. +     }
  291.       /* open the intuition library */
  292.       IntuitionBase = (struct IntuitionBase *)
  293.           OpenLibrary("intuition.library", INTUITION_REV);
  294.       if (IntuitionBase == NULL) {
  295. +                 if (GfxBase) CloseLibrary((struct Library *)GfxBase);
  296.           printf("%%Can not open Intuition\n");
  297.           exit(-1);
  298.       }
  299. +     /* open the ASL library */
  300. +     AslBase = (struct Library *)
  301. +         OpenLibrary("asl.library", 38L);
  302. +     if (AslBase == NULL) {
  303. +                 if (GfxBase) CloseLibrary((struct Library *)GfxBase);
  304. +                 if (IntuitionBase) CloseLibrary((struct Library *)IntuitionBase);
  305. +         printf("%%Can not open asl.library\n");
  306. +         exit(-1);
  307. +     }
  308. + #ifdef FORCE_TOPAZ80
  309. +         theTextAttr = AllocMem(sizeof(struct TextAttr),MEMF_PUBLIC|MEMF_CLEAR);
  310. +         if (theTextAttr == NULL) {
  311. +         printf("%%Not enough memory\n");
  312. +         exit(-2);
  313. +         };
  314. +         theTextAttr->ta_Name = fontname;
  315. +         theTextAttr->ta_YSize = 8;
  316. +         theTextAttr->ta_Style = FS_NORMAL;
  317. +         theTextAttr->ta_Flags = FPF_ROMFONT;
  318. +         theFont = OpenFont(theTextAttr);
  319. + #else
  320. +         theFont = GfxBase->DefaultFont;
  321. + #endif
  322. +         memset(&new_win,0,sizeof(struct NewWindow));
  323. + #ifndef DEBUG_PRE_V39
  324. +     if (IntuitionBase->LibNode.lib_Version >= 39) {
  325. +           scr = OpenScreenTags(0L,SA_LikeWorkbench,TRUE,
  326. +             SA_Title,(ULONG)((UBYTE*)"MicroEMACS 3.12g/Amiga"),
  327. +             SA_Depth,1,
  328. +             SA_SysFont,0,
  329. +             SA_Type,CUSTOMSCREEN,
  330. +             SA_BlockPen,1,SA_DetailPen,0);
  331. +     }
  332. +     else {
  333. + #else
  334. +         /* provide a matching bracket for pre V39 debugging */
  335. +     {
  336. + #endif
  337. +       new_scr = AllocMem((ULONG)sizeof(struct NewScreen),MEMF_PUBLIC|MEMF_CLEAR);
  338. +           if (new_scr == 0L) {
  339. +             if (GfxBase) CloseLibrary((struct Library *)GfxBase);
  340. +         if (IntuitionBase) CloseLibrary((struct Library *)IntuitionBase);
  341. +         if (AslBase) CloseLibrary((struct Library *)AslBase);
  342. +         printf("%%Can not allocate NewScreen structure\n");
  343. +         exit(-1);
  344. +           }
  345. +           DefaultScr = AllocMem(sizeof(struct Screen),MEMF_PUBLIC|MEMF_CLEAR);
  346. +       if (DefaultScr != 0L) { int success;
  347. +         success = GetScreenData(DefaultScr,sizeof(struct Screen), WBENCHSCREEN, NULL);
  348. +         if (success) {
  349. +           new_scr->Width = DefaultScr->Width;
  350. +           new_scr->Height= DefaultScr->Height;
  351. +           new_scr->ViewModes = DefaultScr->ViewPort.Modes;
  352. +             }
  353. +         else {
  354. +           new_scr->Width = 640;
  355. +           new_scr->Height= 200;
  356. +           new_scr->ViewModes = HIRES;
  357. +         }
  358. +             FreeMem(DefaultScr,sizeof(struct Screen));
  359. +             DefaultScr = 0L;
  360. +       }
  361. +       else {
  362. +         new_scr->Width = 640;
  363. +         new_scr->Height= 200;
  364. +         new_scr->ViewModes = HIRES;
  365. +       }
  366. +       new_scr->LeftEdge = 0;
  367. +       new_scr->TopEdge = 0;
  368. +       new_scr->Depth = 1;
  369. +       new_scr->DetailPen = 0;
  370. +       new_scr->BlockPen = 1;
  371. +       new_scr->Type = CUSTOMSCREEN;
  372. + #ifdef FORCE_TOPAZ80
  373. +       new_scr->Font = theTextAttr; /* force use of TOPAZ80 */
  374. + #else
  375. +       new_scr->Font = 0L; /* Use system default font */
  376. + #endif
  377. +       new_scr->DefaultTitle = (unsigned char *)"MicroEMACS 3.12g/Amiga";
  378. +       scr = OpenScreen(new_scr);
  379. +     }
  380.   
  381. +     if (scr == NULL) {
  382. +         printf("%%Can not open a screen\n");
  383. +         exit(-2);
  384. +     }
  385.       /* initialize the new windows attributes */
  386.       new_win.LeftEdge = 0;
  387.       new_win.TopEdge = 0;
  388.       new_win.Width = 640;
  389. !     new_win.Height = scr->Height - scr->BarHeight;
  390.       new_win.DetailPen = 0;
  391.       new_win.BlockPen = 1;
  392.       new_win.Title = (unsigned char *)"MicroEMACS 3.12g/Amiga";
  393. + /*
  394.       new_win.Flags = WINDOWCLOSE | SMART_REFRESH | ACTIVATE |
  395.           WINDOWDRAG | WINDOWDEPTH | WINDOWSIZING | SIZEBRIGHT |
  396.           RMBTRAP | NOCAREREFRESH;
  397.       new_win.IDCMPFlags = CLOSEWINDOW | NEWSIZE | MOUSEBUTTONS |
  398.           RAWKEY;
  399. ! */
  400. !     new_win.Flags = WINDOWCLOSE | SMART_REFRESH | ACTIVATE |
  401. !         WINDOWDRAG | SIZEBRIGHT | BACKDROP | BORDERLESS |
  402. !         RMBTRAP | NOCAREREFRESH;
  403. !     new_win.IDCMPFlags = CLOSEWINDOW | MOUSEBUTTONS |
  404. !         RAWKEY;
  405. !     new_win.Type = CUSTOMSCREEN;
  406.       new_win.FirstGadget = NULL;
  407.       new_win.CheckMark = NULL;
  408. !     new_win.Screen = scr;
  409.       new_win.BitMap = NULL;
  410.       new_win.MinWidth = 100;
  411.       new_win.MinHeight = 25;
  412. !     new_win.MaxWidth = scr->Width;
  413. !     new_win.MaxHeight = scr->Height - scr->BarHeight;
  414.   
  415.       /* open the window! */
  416.       win = (struct Window *)OpenWindow(&new_win);
  417.       if (win == NULL) {
  418. +         if (scr) CloseScreen(scr);
  419. +         if (new_scr) FreeMem(new_scr,(ULONG)sizeof(struct NewScreen));
  420.           printf("%%Can not open a window\n");
  421.           exit(-2);
  422.       }
  423. ! #ifdef FORCE_TOPAZ80
  424. !         if (theFont != NULL) SetFont(win->RPort,theFont);
  425. ! #endif
  426. !         
  427.       /* and open up the console for output */
  428.       con.io_Data = (APTR)win;
  429. !     OpenDevice("console.device", 0, (struct IORequest *)(&con), 0);
  430. !         ConsoleDevice = (struct Library *)con.io_Device;
  431.   
  432.       /* and init all the keyboard flags */
  433.       r_shiftflag = FALSE;
  434. !     l_shiftflag = FALSE;
  435. !     r_altflag = FALSE;
  436.       l_altflag = FALSE;
  437.       r_amiflag = FALSE;
  438.       l_amiflag = FALSE;
  439. ***************
  440. *** 269,282 ****
  441.       /* initialize our private event queue */
  442.       in_init();
  443.   
  444.       /* set the current sizes */
  445. !     newwidth(TRUE, 77);
  446. !     newsize(TRUE, 23);
  447.   
  448.       /* on all screens we are not sure of the initial position
  449.          of the cursor                    */
  450.       ttrow = 999;
  451.       ttcol = 999;
  452.   }
  453.   
  454.   /*
  455. --- 462,480 ----
  456.       /* initialize our private event queue */
  457.       in_init();
  458.   
  459. +     /* font sensitive height and width calculation */
  460. +     term.t_ncol = term.t_mcol = ((win->Width+1)/theFont->tf_XSize);
  461. +         term.t_nrow = term.t_mrow = ((win->Height+1)/theFont->tf_YSize)-1;
  462.       /* set the current sizes */
  463. !     newwidth(TRUE, term.t_mcol);
  464. !     newsize(TRUE, term.t_mrow);
  465.   
  466.       /* on all screens we are not sure of the initial position
  467.          of the cursor                    */
  468.       ttrow = 999;
  469.       ttcol = 999;
  470. +     if (new_scr) FreeMem(new_scr,(ULONG)sizeof(struct NewScreen));
  471.   }
  472.   
  473.   /*
  474. ***************
  475. *** 291,299 ****
  476.       ttflush();
  477.   
  478.       /* and now close up shop */
  479. !     CloseDevice(&con);
  480. !     CloseWindow(win);
  481.       OpenWorkBench();
  482.   }
  483.   
  484.   /*
  485. --- 489,506 ----
  486.       ttflush();
  487.   
  488.       /* and now close up shop */
  489. !     CloseDevice((struct IORequest *)(&con));
  490. !         ConsoleDevice = 0L;
  491. !     if (win) CloseWindow(win);
  492. !         if (scr) CloseScreen(scr);
  493. ! #ifdef FORCE_TOPAZ80
  494. !         if (theFont) CloseFont(theFont);
  495. !         if (theTextAttr) FreeMem(theTextAttr,(ULONG)(sizeof(struct TextAttr)));
  496. ! #endif
  497.       OpenWorkBench();
  498. +     if (AslBase) CloseLibrary(AslBase);
  499. +         if (IntuitionBase) CloseLibrary((struct Library *)IntuitionBase);
  500. +         if (GfxBase) CloseLibrary((struct Library *)GfxBase);
  501.   }
  502.   
  503.   /*
  504. ***************
  505. *** 377,382 ****
  506. --- 584,590 ----
  507.   {
  508.       register int eventX, eventY;    /* local copies of the event info */
  509.       struct IntuiMessage *event;    /* current event to repond to */
  510. +         __aligned struct InputEvent ievent = {NULL,IECLASS_RAWKEY,0,0,0};
  511.       ULONG class;    /* class of event */
  512.       USHORT code;    /* data code */
  513.       SHORT x,y;    /* mouse x/y position at time of event */
  514. ***************
  515. *** 386,400 ****
  516.       Wait(1 << win->UserPort->mp_SigBit);
  517.   
  518.       /* get the event and parse it up */
  519. !     while (event = GetMsg(win->UserPort)) {
  520.           class = event->Class;
  521.           code = event->Code;
  522.           eventX = event->MouseX;
  523.           eventY = event->MouseY;
  524. !         ReplyMsg(event);
  525.   
  526.           /* a normal keystroke? */
  527. !         if (class == RAWKEY) {            dokey(code);
  528.               continue;
  529.           }
  530.   
  531. --- 594,613 ----
  532.       Wait(1 << win->UserPort->mp_SigBit);
  533.   
  534.       /* get the event and parse it up */
  535. !     while (event = (struct IntuiMessage *)GetMsg(win->UserPort)) {
  536.           class = event->Class;
  537.           code = event->Code;
  538.           eventX = event->MouseX;
  539.           eventY = event->MouseY;
  540. !         ievent.ie_Code=code;
  541. !         ievent.ie_Qualifier=event->Qualifier;
  542. !         ievent.ie_position.ie_addr = *((APTR*)event->IAddress);
  543. !         ReplyMsg((struct Message *)event);
  544.   
  545.           /* a normal keystroke? */
  546. !         if (class == RAWKEY) {
  547. !             dokey(&ievent);
  548.               continue;
  549.           }
  550.   
  551. ***************
  552. *** 406,421 ****
  553.   
  554.           /* resolve the mouse address (border adjusted) */
  555.           if (class == NEWSIZE) {
  556. !             x = (win->Width - 5) / CRWIDTH;
  557. !             y = (win->Height - 10) / CRHEIGHT;
  558.           } else {
  559. !             x = (eventX - 5) / CRWIDTH;
  560. !             y = (eventY - 10) / CRHEIGHT;
  561.           }
  562. !         if (x > 77)
  563. !             x = 77;
  564. !         if (y > 23)
  565. !             y = 23;
  566.   
  567.           /* are we resizing the window? */
  568.           if (class == NEWSIZE) {
  569. --- 619,634 ----
  570.   
  571.           /* resolve the mouse address (border adjusted) */
  572.           if (class == NEWSIZE) {
  573. !             x = (win->Width) / CRWIDTH;
  574. !             y = (win->Height-scr->BarHeight) / CRHEIGHT;
  575.           } else {
  576. !             x = (eventX) / CRWIDTH;
  577. !             y = (eventY-scr->BarHeight) / CRHEIGHT;
  578.           }
  579. !         if (x > term.t_mcol)
  580. !             x = term.t_mcol;
  581. !         if (y > term.t_mrow)
  582. !             y = term.t_mrow;
  583.   
  584.           /* are we resizing the window? */
  585.           if (class == NEWSIZE) {
  586. ***************
  587. *** 462,482 ****
  588.       con.io_Command = CMD_WRITE;
  589.   
  590.       /* and perform the I/O */
  591. !     SendIO(&con);
  592.   }
  593.   
  594.   
  595.   /* process an incomming keyboard code */
  596.   
  597. ! dokey(code)
  598. ! int code;    /* raw keycode to convert */
  599.   {
  600.       register int ekey;    /* translate emacs key */
  601.       register int dir;    /* key direction (up/down) */
  602.       char buf[NSTRING];
  603.   
  604.       /* decode the direction of the key */
  605.       dir = TRUE;
  606.       if (code > 127) {
  607. --- 675,698 ----
  608.       con.io_Command = CMD_WRITE;
  609.   
  610.       /* and perform the I/O */
  611. !     SendIO((struct IORequest *)(&con));
  612.   }
  613.   
  614.   
  615.   /* process an incomming keyboard code */
  616.   
  617. ! void dokey(IEvent)
  618. ! struct InputEvent *IEvent;
  619.   {
  620.       register int ekey;    /* translate emacs key */
  621.       register int dir;    /* key direction (up/down) */
  622.       char buf[NSTRING];
  623. +         char cvbuf[16];
  624. +         int numchars;
  625. +         int code = IEvent->ie_Code;
  626.   
  627. + #ifdef OLDSTYLE_KEYS
  628. + /* this works for US keyboard only, totally useless for intl. keyboards */
  629.       /* decode the direction of the key */
  630.       dir = TRUE;
  631.       if (code > 127) {
  632. ***************
  633. *** 516,521 ****
  634. --- 732,782 ----
  635.       /* now apply the ALTD modifier */
  636.       if (r_altflag || l_altflag)
  637.           ekey |= ALTD;
  638. + #else
  639. + /* For intl. keyboards use this here */
  640. +     /* decode the direction of the key */
  641. +     dir = TRUE;
  642. +     if (code > 127) {
  643. +         code = code & 127;
  644. +         dir = FALSE; /* Key released */
  645. +     }
  646. +         numchars = RawKeyConvert(IEvent,cvbuf,16,0L);
  647. +     if (numchars == 1) {
  648. +           ekey = cvbuf[0];
  649. +       /* up keystrokes are ignored for the rest of these */
  650. +     }
  651. +     else {
  652. +       if (code >= 0x60) {
  653. +         switch (code) {
  654. +             case 0x60:    l_shiftflag = dir;    break;
  655. +             case 0x61:    r_shiftflag = dir;    break;
  656. +             case 0x62:    lockflag    = dir;    break;
  657. +             case 0x63:    ctrlflag    = dir;    break;
  658. +             case 0x64:    l_altflag   = dir;    break;
  659. +             case 0x65:    r_altflag   = dir;    break;
  660. +             case 0x66:    l_amiflag   = dir;    break;
  661. +             case 0x67:    r_amiflag   = dir;    break;
  662. +         }
  663. +         return;
  664. +       }
  665. +       /* first apply the shift and control modifiers */
  666. +       if (ctrlflag)
  667. +         ekey = keytrans[code].rw_ccode;
  668. +       else if (l_shiftflag || r_shiftflag || lockflag)
  669. +         ekey = keytrans[code].rw_scode;
  670. +       else
  671. +         ekey = keytrans[code].rw_code;
  672. +         }
  673. +     if (dir == FALSE) return;
  674. +         if ((numchars!=1) || ((ekey != '@') && (ekey < 0x7F)))
  675. +       /* now apply the ALTD modifier */
  676. +       if (r_altflag || l_altflag)
  677. +         ekey |= ALTD;
  678. + #endif
  679.   
  680.       /* apply the META prefix */
  681.       if (r_amiflag || l_amiflag) {
  682. ***************
  683. *** 886,892 ****
  684.   }
  685.   
  686.   #else
  687. ! adoshello()
  688.   {
  689.   }
  690.   #endif
  691. --- 1147,1198 ----
  692.   }
  693.   
  694.   #else
  695. ! void adoshello(void)
  696.   {
  697.   }
  698.   #endif
  699. + char *MakePathname(Path, Filename)
  700. + char *Path;
  701. + char *Filename;
  702. + {
  703. +   static char namebuffer[256];
  704. +   strcpy(namebuffer,Path);
  705. +   if (*namebuffer != '\0') {
  706. +     char ch=namebuffer[strlen(namebuffer)-1];
  707. +     if ((ch != ':') && (ch != '/')) strcat(namebuffer,"/");
  708. +   }
  709. +   strcat(namebuffer,Filename);
  710. +   return namebuffer;
  711. + } /* MakePathname */
  712. + int FileReq(rtitle, filename, maxlen)
  713. + char *rtitle;
  714. + char *filename;
  715. + unsigned maxlen;
  716. + {
  717. +   struct FileRequester *frp;
  718. +   static char DirStr[256];
  719. +   static char FileStr[256];
  720. +   int rc;
  721. +   frp = AllocAslRequestTags(ASL_FileRequest,ASLFR_Screen,(ULONG)scr,
  722. +     ASLFR_TitleText,(ULONG)rtitle,
  723. +     ASLFR_DoPatterns,TRUE,
  724. +     ASLFR_InitialPattern,(ULONG)((UBYTE *)"~(#?.info)"),
  725. +     ASLFR_InitialHeight,(scr->Height*11L) >> 4,
  726. +     TAG_DONE);
  727. +   if (frp != 0L) {
  728. +     if (RequestFile(frp) != 0) {
  729. +       strncpy(DirStr,frp->fr_Drawer,256);
  730. +       strncpy(FileStr,frp->fr_File,256);
  731. +       strncpy(filename,MakePathname(DirStr,FileStr),maxlen);
  732. +       rc = 0;
  733. +     }
  734. +     else rc = -1;
  735. +     FreeFileRequest(frp);
  736. +   }
  737. +   else rc = -1;
  738. +   return rc;
  739. + } /* FileReq */
  740. diff -adrc orig/src/input.c ue312/src/input.c
  741. *** orig/src/input.c    Wed Apr 21 10:23:04 1993
  742. --- ue312/src/input.c    Wed Apr 24 13:58:38 1996
  743. ***************
  744. *** 207,212 ****
  745. --- 207,216 ----
  746.       if (!FILENAMEREPLY(prompt, sp, NFILEN))
  747.           return NULL;
  748.   #else
  749. + #if    AMIGA
  750. +     static char sp[NFILEN];
  751. +     if (FileReq(prompt,sp,NFILEN)!=0) return NULL;
  752. + #else
  753.       char *sp;    /* ptr to the returned string */
  754.   
  755.       /* get a file name, default to current buffer's */
  756. ***************
  757. *** 214,219 ****
  758. --- 218,224 ----
  759.           sp = complete(prompt, curbp->b_fname, CMP_FILENAME, NFILEN);
  760.       else
  761.           sp = complete(prompt, NULL, CMP_FILENAME, NFILEN);
  762. + #endif
  763.   #endif
  764.   #if    MSDOS | OS2
  765.       /* change forward slashes to back */
  766. diff -adrc orig/src/search.c ue312/src/search.c
  767. *** orig/src/search.c    Tue Apr 20 14:56:42 1993
  768. --- ue312/src/search.c    Wed Apr 24 16:33:03 1996
  769. ***************
  770. *** 6,11 ****
  771. --- 6,14 ----
  772.    */
  773.   
  774.   #include <stdio.h>
  775. + #ifdef __STDC__
  776. + #include <string.h>
  777. + #endif
  778.   #include "estruct.h"
  779.   #include "eproto.h"
  780.   #include "edef.h"
  781. diff -adrc orig/src/unix.c ue312/src/unix.c
  782. *** orig/src/unix.c    Wed Apr 21 11:09:20 1993
  783. --- ue312/src/unix.c    Wed Apr 24 13:58:39 1996
  784. ***************
  785. *** 899,904 ****
  786. --- 899,913 ----
  787.       /* Get size from termcap */
  788.       term.t_nrow = tgetnum("li") - 1;
  789.       term.t_ncol = tgetnum("co");
  790. +     if (NULL!=(cp=getenv("LINES"))) { int row;
  791. +         sscanf (cp, "%d", &row);
  792. +         if (row) {
  793. +             term.t_mrow= row-1;
  794. +             term.t_nrow= row-1;
  795. +         }
  796. +     }
  797.       if (term.t_nrow < 3 || term.t_ncol < 3) {
  798.           puts("Screen size is too small!");
  799.           exit(1);
  800. ***************
  801. *** 1325,1332 ****
  802.   #if USG || AUX || SMOS || HPUX8 || XENIX
  803.   /** Rename a file **/
  804.   int rename(file1, file2)
  805. ! char * file1;                /* Old file name        */
  806. ! char * file2;                /* New file name        */
  807.   {
  808.       struct stat buf1;
  809.       struct stat buf2;
  810. --- 1334,1341 ----
  811.   #if USG || AUX || SMOS || HPUX8 || XENIX
  812.   /** Rename a file **/
  813.   int rename(file1, file2)
  814. ! const char *file1;                /* Old file name        */
  815. ! const char *file2;                /* New file name        */
  816.   {
  817.       struct stat buf1;
  818.       struct stat buf2;
  819.